<div id="nav"><!-- Navigation with tabs -->
    <ul>
        <a href="<?php echo url_for('sales_index_contacts') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_contacts.png') ?>Contacts</li></a>
        <a href="<?php echo url_for('sales_index_orders') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_orders.png') ?>Orders</li></a>
        <a href="<?php echo url_for('sales_index_pnp') ?>"><li class="no_sel"><span style="float: left;"><?php echo image_tag('Icons/ic_menu_products_parts.png') ?></span><span style="float: left; margin: -2px 0 0 0;">Materials</span><span style=" float: left; margin-top: -5px;">&amp; Products</span></li></a>
        <a href="<?php echo url_for('purchase_index') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_purchase.png') ?>Purchase</li></a>
        <a href="<?php echo url_for('stock_index') ?>"><li class="sel"><?php echo image_tag('Icons/ic_menu_stock.png') ?>Stock</li></a><!-- SELECTED TAB -->
        <?php if($sf_user->isSuperAdmin()){ ?>
            <a href="<?php echo url_for('admin_index') ?>"><li class="no_sel"><?php echo image_tag('Icons/ic_menu_stock.png') ?>Admin</li></a>
        <?php } ?>
    </ul>
</div>
<div id="page">
    <div id="par_header">
        <div id="search">
            <?php echo form_tag('stock_filter_pnp') ?>
            <fieldset>
                <legend class="bold">Search Material</legend>
                <table>
                    <tr>
                        <td>Material No.</td>
                        <td class="input_small"><?php echo $filterParts['part_number']->render() ?></td>
                    </tr>
                    <tr>
                        <td>Name</td>
                        <td class="input_normal"><?php echo $filterParts['name']->render() ?></td>
                    </tr>
                    <tr>
                        <td>Type</td>
                        <td class="input_normal"><?php echo $filterParts['type']->render() ?></td>
                    </tr>
                    <tr><td><input type="submit" value="" name="submit_filter" class="bt_search" title="Search material"/></td></tr>
                    </table>
                    <div id="del_list"><!-- refresh the material list, back to full list -->
                        <a href="<?php echo url_for('stock_index') ?>">
                            <img src="<?php echo image_path('Buttons/bt_cancel_small.png') ?>" onmouseover="this.src='<?php echo image_path('Buttons/bt_cancel_small_hov.png') ?>';" onmouseout="this.src='<?php echo image_path('Buttons/bt_cancel_small.png') ?>';" width="55px" title="Back to complete material list"/><!-- when having mouse on it, it shows the text 'Back to complete material list' -->
                        </a>
                    </div>
                    <span id="tooltip1"><a href=""><img src="<?php echo image_path('Buttons/bt_help.png') ?>" /><span>Fill in one or more field(s) to search material</span></a></span>
                </fieldset>   
            </div>
            <div id="search2">
                <?php echo form_tag('stock_filter_pnp') ?>
                <fieldset>
                    <table>
                        <legend class="bold">Search Product</legend>
                        <tr>
                            <td>Product No.</td>
                            <td class="input_small"><?php echo $filterProducts['product_number']->render() ?></td>
                        </tr>
                        <tr>
                            <td>Name</td>
                            <td class="input_normal"><?php echo $filterProducts['name']->render() ?></td>
                        </tr>
                        <tr>
                            <td>Type</td>
                            <td class="input_normal"><?php echo $filterProducts['type']->render() ?></td>
                        </tr>
                        <tr><td><input type="submit" value="" name="submit_filter" class="bt_search" title="Search product"/></td></tr>
                    </table>
                    <div id="del_list">
                        <a href="<?php echo url_for('stock_index') ?>">
                            <img src="<?php echo image_path('Buttons/bt_cancel_small.png') ?>" onmouseover="this.src='<?php echo image_path('Buttons/bt_cancel_small_hov.png') ?>';" onmouseout="this.src='<?php echo image_path('Buttons/bt_cancel_small.png') ?>';" width="55px" title="Back to complete product list"/>
                        </a>
                    </div>
                    <span id="tooltip2"><a href=""><img src="<?php echo image_path('Buttons/bt_help.png') ?>" /><span>Fill in one or more field(s) to search products</span></a></span>
                </fieldset>   
            </div>
        </div>
        <div id="prod_par">  
            <h2>Materials</h2>
            <?php
                include_partial('parts', array('parts' => $pagerParts->getResults()));
                include_partial('pagerMultiple', array('pager' => $pagerParts, 'url' => 'stock_index', 'kind' => 'part', 'previousKind' => 'product', 'previousPager' => $pagerProducts));
                ?>
            <h2>Products</h2>
                <?php
                include_partial('products', array('products' => $pagerProducts->getResults()));
                include_partial('pagerMultiple', array('pager' => $pagerProducts, 'url' => 'stock_index', 'kind' => 'product', 'previousKind' => 'part', 'previousPager' => $pagerParts));
            ?>
        </div>
    </div>
